package data_structures_and_algorithms.tree;

import common.TreeNode;

/**
 * @ClassName Code_0104_maxDepth
 * @Description: https://leetcode.cn/problems/maximum-depth-of-binary-tree/submissions/
 * @Author: yongliang.ma
 * @Create_time:2022/10/26 20:59
 */
public class Code_0104_maxDepth {

    public int maxDepth(TreeNode root) {
        if (root == null)
            return 0;

        return Math.max(maxDepth(root.left) + 1, maxDepth(root.right) + 1);
    }
}
